import request from '@/utils/request'

export function getEmployeeList(params) {
  return request({
    url: '/users',
    method: 'get',
    params
  })
}

export function getCount() {
  return request({
    url: '/users/count'
  })
}

export function registerUser(data) {
  return request({
    url: '/auth/local/register',
    method: 'post',
    data
  })
}

export function getEmployeeById(id) {
  return request({
    url: `/users/${id}`,
    method: 'get'
  })
}

export function delUser(id) {
  return request({
    url: `/users/${id}`,
    method: 'delete'
  })
}

export function getRoles() {
  return request({
    url: '/roles'
  })
}

export function editUser(data) {
  return request({
    url: `/users/${data.id}`,
    method: 'put',
    data
  })
}
